package io.gitee.yeningx.example.controller;

import io.gitee.yeningx.example.ex.BusinessError;
import io.gitee.yeningx.tools.valid.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ex")
public class ExceptionController {
    @RequestMapping("/hello")
    public String hello() {
        throw new NullPointerException();
    }

    @RequestMapping("/hello2")
    public String hello2() {
        Assert.isTrue(1 == 0, BusinessError.BizErr);
        return "hello2";
    }
}
